<?php
$file =  $_FILES['image'];;
 		 
		$destinationPath = public_path().'\upload';
		
		$filename = $file->getClientOriginalName();
		
		$upload_success = $file->move($destinationPath, $filename);	
		$data = getimagesize($destinationPath."\\".$filename);
         
        $link = "../public/upload/".$filename;
        
        $res = array("upload" => array(
                                "links" => array("original" => $link),
                                "image" => array("width" => $data[0],
                                                 "height" => $data[1]
                                                )                              
                    ));
        return json_encode($res);
        ?>